<table class="table table-hover">
	<thead>
		<tr>
			<th>
				<div class="btn-group">
					<button data-toggle="dropdown" class="btn btn-primary dropdown-toggle btn-sm" type="button">标题 <span class="caret"></span></button>
					<ul role="menu" class="dropdown-menu pull-right">
						<li><a href="javascript:sortChange('title')" ><i class="glyphicon glyphicon-arrow-down"></i> 顺序</a></li>
						<li><a href="javascript:sortChange('-title')" ><i class="glyphicon glyphicon-arrow-up"></i> 倒序</a></li>
					</ul>
				</div>
			</th>
			<th>
				<div class="btn-group">
					<button data-toggle="dropdown" class="btn btn-primary dropdown-toggle btn-sm" type="button">名称 <span class="caret"></span></button>
					<ul role="menu" class="dropdown-menu pull-right">
						<li><a href="javascript:sortChange('name')" ><i class="glyphicon glyphicon-arrow-down"></i> 顺序</a></li>
						<li><a href="javascript:sortChange('-name')" ><i class="glyphicon glyphicon-arrow-up"></i> 倒序</a></li>
					</ul>
				</div>
			</th>
			<th>
				<div class="btn-group">
					<button data-toggle="dropdown" class="btn btn-primary dropdown-toggle btn-sm" type="button">状态 <span class="caret"></span></button>
					<ul role="menu" class="dropdown-menu pull-right">
						<li><a href="javascript:sortChange('Status')" ><i class="glyphicon glyphicon-arrow-down"></i> 顺序</a></li>
						<li><a href="javascript:sortChange('-Status')" ><i class="glyphicon glyphicon-arrow-up"></i> 倒序</a></li>
					</ul>
				</div>
			</th>
			<th>
				<div class="btn-group">
					<button data-toggle="dropdown" class="btn btn-primary dropdown-toggle btn-sm" type="button">操作 <span class="caret"></span></button>
					<ul role="menu" class="dropdown-menu pull-right">
						<li><a href="javascript:AddRole()" ><i class="fui-plus-circle"></i> 新增</a></li>
					</ul>
				</div>
			</th>
		</tr>
	</thead>
	<tbody>
	{{range .griddate}}
		<tr {{if eq .Status 2}} class="success" {{end}}>
			<th>{{.Title}}</th>
			<th>{{.Name}}</th>
			<th>{{if eq .Status 2}} 启用
				{{else}} 禁用 {{end}}
			</th>
			<th>
				<div class="btn-group">
					<button data-toggle="dropdown" class="btn btn-primary dropdown-toggle btn-xs" type="button">
						操作 <span class="caret"></span>
					</button>
					<ul role="menu" class="dropdown-menu pull-right">
						<li>
							<a href="javascript:EditRole('{{.Id}}')">
								<i class="fui-check-circle"></i> 编辑角色
							</a>
						</li>
						<li>
							<a href='{{urlfor "Admin.UserController.RoleAccess" "roleid" .Id}}'>
								<i class="fui-cross-circle"></i> 角色授权
							</a>
						</li>
						<li>
							<a class="a_post" href='{{urlfor "Admin.UserController.DelRole" "Id" .Id}}'>
								<i class="fui-cross-circle"></i> 删除角色
							</a>
						</li>
						<li class="divider"></li>
						<li>
						{{if eq .Status 2}} 
							<a class="a_post" href='{{urlfor "Admin.UserController.UpdateRole" "Id" .Id "Status" 1}}'>
								<span class="fui-lock"></span> 禁用
							</a>
						{{else}} 
							<a class="a_post" href='{{urlfor "Admin.UserController.UpdateRole" "Id" .Id "Status" 2}}'>
								<span class="fui-checkbox-checked"></span> 启用
							</a>
						{{end}}
						</li>
					</ul>
				</div>
			</th>
		</tr>
	{{end}}
	</tbody>
</table>
<div class="row">
	<nav class="pull-right">
	{{if .paginator.HasPages}}
		<ul class="pagination pagination">
			{{if .paginator.HasPrev}}
			<li><a href="{{.paginator.PageLinkFirst}}">首页</a></li>
			<li><a href="{{.paginator.PageLinkPrev}}">&laquo;</a></li>
			{{else}}
			<li class="disabled"><a>首页</a></li>
			<li class="disabled"><a>&laquo;</a></li>
			{{end}}
			{{range $index, $page := .paginator.Pages}}
			<li{{if $.paginator.IsActive .}} class="active"{{end}}>
				<a href="{{$.paginator.PageLink $page}}">{{$page}}</a>
			</li>
			{{end}}
			{{if .paginator.HasNext}}
			<li><a href="{{.paginator.PageLinkNext}}">&raquo;</a></li>
			<li><a href="{{.paginator.PageLinkLast}}">末页</a></li>
			{{else}}
			<li class="disabled"><a>&raquo;</a></li>
			<li class="disabled"><a>末页</a></li>
			{{end}}
		</ul>
	{{end}}
	</nav>
</div>
